﻿using AutoMapper;
using MediatR;
using SmartCity.ProcessEngine.API.Domain;
using SmartCity.ProcessEngine.API.ErrorCode;
using SmartCity.ProcessEngine.API.Infrastructrue.Interfaces;
using SmartCity.ProcessEngine.API.Read.Applications.Commands;
using SmartCity.ProcessEngine.API.Read.DTOS;

namespace SmartCity.ProcessEngine.API.Read.Applications.CommandHandlers
{
    /// <summary>
    /// 表单明细查询请求命令
    /// </summary>
    public class FormDetailQueryCommandHandler : IRequestHandler<FormDetailQueryCommand, APIResult<List<FormDetailDTO>>>
    {
        /// <summary>
        /// 表单明细仓储
        /// </summary>
        private readonly IBaseRespository<WF_FormDetail> formdetailRep;
        /// <summary>
        /// 映射
        /// </summary>
        private readonly IMapper mapper;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="formdetailRep">表单明细仓储</param>
        /// <param name="mapper">映射</param>
        public FormDetailQueryCommandHandler(IBaseRespository<WF_FormDetail> formdetailRep, IMapper mapper)
        {
            this.formdetailRep = formdetailRep;
            this.mapper = mapper;
        }
        /// <summary>
        /// 请求
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public Task<APIResult<List<FormDetailDTO>>> Handle(FormDetailQueryCommand request, CancellationToken cancellationToken)
        {
            APIResult<List<FormDetailDTO>> result=new APIResult<List<FormDetailDTO>>();
            result.Code=APIResultCode.SearchSuccess;
            result.Message=APIResultCode.SearchSuccess.ToString();





            return Task.FromResult(result); 
        }
    }
}
